#ifndef OTHERTABLEMANAGEMENT_H
#define OTHERTABLEMANAGEMENT_H

#include <QObject>
#include <memory>
#include "./Common/config.h"

class OtherTableManagement
{
public:
    explicit OtherTableManagement();
};

class SQLManagement;

class AppointmentManagement
{
public:
    explicit AppointmentManagement(SQLManagement* sqlm);

    bool Insert(const QString& doctorId, const QString& patientId);
    QVariantList GetPaitentInfoByDID(const QString &doctorId);

private:
    std::shared_ptr<SQLManagement> sql_m;
};

class AdviceManagement // 医嘱表
{
public:
    explicit AdviceManagement(SQLManagement* sqlm);

    bool Insert(const QString &doctorId, const QString &patientId, const QString &advice);
    QVariantMap GetInstructionByPID(const QString &patientId);
    QVariantList GetAdviceIdByID(const QString& paitentId, const QString& doctorId);
    QString GetDoctorIdByAdviceID(const QString& adviceId);
private:
    std::shared_ptr<SQLManagement> sql_m;
};

class PrescriptionManagement // 处方表
{
public:
    explicit PrescriptionManagement(SQLManagement* sqlm);

    bool Insert(const QString &adviceId, const QString &medication, const QString &dosage,
                const QString &frequency, const QString &cost);
    QVariantMap GetPrescriptionByPID(const QString &patientId);
    bool UpdatePrescription(const QString &prescriptionId, const QString &medication, const QString &dosage);
    bool DeletePrescription(const QString &prescriptionId);

private:
    std::shared_ptr<SQLManagement> sql_m;
};

class MedicalRecordManagement // 病历表
{
public:
    explicit MedicalRecordManagement(SQLManagement* sqlm);

    bool Insert(const QString &patientId, const QString &doctorId, const QString &diseaseName, const QString &details);
    QVariantMap GetMedicalRecordByPID(const QString &patientId);
    bool UpdateMedicalRecord(const QString &recordId, const QString &record);
    bool DeleteMedicalRecord(const QString &recordId);


private:
    std::shared_ptr<SQLManagement> sql_m;
};


#endif // OTHERTABLEMANAGEMENT_H
